package org.lboot.chat.api.file;

import org.lboot.chat.module.file.model.ChatFile;
import org.lboot.chat.module.file.FileListResult;
import org.lboot.chat.module.file.params.LocalFileParams;
import org.lboot.chat.module.file.params.WebFileParams;
import org.lboot.mrest.annotation.Body;
import org.lboot.mrest.annotation.Get;
import org.lboot.mrest.annotation.MicroRest;
import org.lboot.mrest.annotation.Post;

@MicroRest
public interface FileApi {

    @Post(value = "#{openai.chat.host}/v1/files",headers = {
            "Content-Type:multipart/form-data",
            "Authorization: Bearer #{openai.chat.key}"
    })
    ChatFile uploadFile(@Body LocalFileParams params);

    @Post(value = "#{openai.chat.host}/v1/files",headers = {
            "Content-Type:multipart/form-data",
            "Authorization: Bearer #{openai.chat.key}"
    })
    ChatFile uploadFile(@Body WebFileParams params);


    @Get(value = "#{openai.chat.host}/v1/files",headers = {
            "Authorization: Bearer #{openai.chat.key}"
    })
    FileListResult listFiles();

}
